<div class="page-orderlist">
	<div class="order-header clearfix">
		<a href="javascript:void(0);" ng-click="switchTab('全部')" class="order-tab-title" ng-class="{'selected':selection.tab == '全部'}">全部</a>
	</div>
	<div class="orderlist-wrap">
		<ul class="order-list" ng-if="periodList[selection.tab] && periodList[selection.tab].length>0">
			<li class="order-item" ng-repeat="order in periodList[selection.tab]">
				<div class="order-item-title clearfix">
					<div class="left">订单号：{{order.order_id}}</div>
					<div class="right {{order.status}}">{{order.status}}</div>
				</div>
				<div class="order-item-content">
					<a class="order-item-content-link" href="javascript:void(0);" ng-click="gotoOrder(order.order_id)">
						<div class="one-product" ng-if="order.product_detail && order.product_detail.length == 1">
							<table class="one-table">
								<tr>
									<td class="img"><img ng-src="{{order.product_detail[0].image}}"></td>
									<td class="name"><div class="auto-cut-word-two-line">{{order.product_detail[0].name}}</div></td>
									<td></td>
								</tr>
							</table>
						</div>
						<div class="more-products" ng-if="order.product_detail && order.product_detail.length>1">
							<table class="more-table">
								<tr>
									<td ng-repeat="(key,orderProduct) in order.product_detail" ng-if="key<3">
										<img ng-src="{{orderProduct.image}}">
									</td>
									<td class="more-td" ng-if="order.product_detail.length>3">
										更多 > 
									</td>
								</tr>
							</table>
						</div>
					</a>
				</div>
				<div class="order-item-footer clearfix">
					<div class="price">应付款：{{order.total}}</div>
					<div class="options">

						还款日期:
						<font color="red">{{order.pay_date}}</font>
						<!--<a class="option-btn option-pay" href="javascript:void(0);" ng-if="order.need_pay == 1" ng-click="showAllPayments()">去支付</a>-->

						<!-- <a class="option-btn option-pay" href="javascript:void(0);" ng-if="order.status == '待付款'" ng-click="gotoPay(order.order_id)">去支付</a>
						<a class="option-btn option-pay" href="javascript:void(0);" ng-if="order.status == '全部发货'" ng-click="confirmReceived(order.order_id)">确认收货</a> -->

						<a class="option-btn option-pay" href="javascript:void(0);" ng-if="order.luckydraw" ng-click="gotoLuckydraw(order)">幸运抽奖 </a>
					</div>
				</div>
				<div class="order-item-footer clearfix" style="font-size:12px" ng-if="order.luckydraw">
					<div class="options">
						<span>
							剩余 {{order.luckydraw.left_times}} 次
							<span ng-show="order.luckydraw.hitted_prices.length>0">(已抽中 <span ng-repeat="hp in order.luckydraw.hitted_prices">{{hp.product_name}} </span>)</span>
						</span>
					</div>
				</div>
			</li>
		</ul>
		<div class="empty-order" ng-if="!periodList[selection.tab] || periodList[selection.tab].length<1">
			<div>暂无相关订单</div>
		</div>
	</div>
</div>

<script type="text/ng-template" id="confirmReceivedDialog.html">
  <div class="dialog confirm-dialog" ng-click="$event.stopPropagation();">
    <p class="title ngdialog-text-center">是否确认收货？</p>
    <div class="ngdialog-buttons">
      <button type="button" class="ngdialog-button ngdialog-button-secondary" ng-click="closeThisDialog(0);$event.stopPropagation()">取消</button>
      <button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="confirm(1);$event.stopPropagation()">确认</button>
    </div>
  </div>
</script>